package my.action;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import my.commons.PagerManager;
import my.domain.Page;
import my.utils.Constant;

import org.apache.struts2.interceptor.ApplicationAware;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;

public class BaseActionSupport extends ActionSupport implements ServletRequestAware, ServletResponseAware, SessionAware, ApplicationAware, Constant {
	private static final long serialVersionUID = 1L;
	protected Map<String, Object> session;
	protected Map<String, Object> application;
	protected HttpServletRequest request;
	protected HttpServletResponse response;
	protected String errorMessage = "";
	protected String resultMsg;
	protected int resultStatus;
	protected Page pager = PagerManager.getPager();
	public void setSession(Map<String, Object> session) {
		this.session = session;
	}

	public void setApplication(Map<String, Object> application) {
		this.application = application;
	}

	public void setServletRequest(HttpServletRequest request) {
		this.request = request;
	}

	public void setServletResponse(HttpServletResponse response) {
		this.response = response;
	}

	public final String getErrorMessage() {
		return errorMessage;
	}

	public final void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}

	public final String getResultMsg() {
		return resultMsg;
	}

	public final void setResultMsg(String resultMsg) {
		this.resultMsg = resultMsg;
	}

	public final int getResultStatus() {
		return resultStatus;
	}

	public final void setResultStatus(int resultStatus) {
		this.resultStatus = resultStatus;
	}

	public final Page getPager() {
		return pager;
	}

	public final void setPager(Page pager) {
		this.pager = pager;
	}
}
